<%@ page import="com.nus.beans.Project" %>
<%@ page import="java.util.List" %>
<%@ page import="com.nus.beans.User" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="org.apache.commons.lang3.StringEscapeUtils" %>
<%@ page import="com.nus.beans.UserType" %>
<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 9/26/12
  Time: 11:52 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Project Information</title></head>

<%
    Project project = (Project) request.getAttribute("project");
    List<User> assigneesList = (List<User>) request.getAttribute("assigneesList");
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
    User currentUser = (User) session.getAttribute("user");
%>
<body>

<table>
    <tr>
        <td>Project Name:</td>
        <td><%= StringEscapeUtils.escapeXml(project.getProjectName())%></td>
    </tr>
     <tr>
        <td>Project Status:</td>
        <td><%= project.getStatus().toString()%></td>
    </tr>
    <tr>
        <td>Start Date:</td>
        <td><%=formatter.format(project.getStartingDate())%>
            </td>
    </tr>
   <tr>
        <td>Estimated End Date:</td>
        <td><%=formatter.format(project.getEstimatedEndDate())%></td>
    </tr>
        <tr>
        <td>Deadline:</td>
        <td><%=formatter.format(project.getDeadline())%></td>
    </tr>
    <% if(currentUser.getUserType().equals(UserType.PM)){ %>

        <tr><td>Assignees List:</td>
            <td><table>
                <%
                    for(User user : assigneesList){%>
                <tr>
                    <td><%=StringEscapeUtils.escapeXml(user.getFirstName()) + " " + StringEscapeUtils.escapeXml(user.getLastName()) + "       " + user.getUserType().toString()%></td>
                </tr>
                <% } %>
            </table></td>
        </tr>

    <% } %>

</table>
 <a href="viewHome.do">Home</a>
</body>
</html>